﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'RegistroOTTerminate')
	BEGIN
		DROP  Procedure  RegistroOTTerminate
	END
GO


CREATE PROCEDURE RegistroOTTerminate 	
	(	
		@empresaId AS INT,
		@numeroOT AS VARCHAR(30)	
	)	
AS
BEGIN	
	SET NOCOUNT ON
	
	UPDATE Lit_OrdenTrabajo
	SET		Estado = 'T',
			FechaFinal = GETDATE()
	WHERE EmpresaId = @empresaId
	  AND NumeroOT = @numeroOT
		
	SET NOCOUNT OFF
END
GO   